package com.example.android.network;

import java.util.HashMap;

public enum InPacketType {
	UpdateLocation("C"), AddPlayer("B"), Acceptation("K"), Statistics("S"), RemovePlayer(
			"D"), ;

	private static HashMap<String, InPacketType> retranslations = new HashMap<String, InPacketType>();
	private final String translation;

	static {
		for (InPacketType packetType : InPacketType.values()) {
			retranslations.put(packetType.translation, packetType);
		}
	}

	InPacketType(String translation) {
		this.translation = translation;
	}

	public String getTranslation() {
		return translation;
	}

	public static InPacketType retranslate(String translation) {
		return retranslations.get(translation);
	}
}
